package it.javaweb.actions.materie;

import it.javaweb.beans.Materia;
import it.javaweb.beans.Utente;
import it.javaweb.dao.MateriaDAO;
import it.javaweb.dao.UtenteDAO;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

public class ListaMaterieController extends AbstractController {

private MateriaDAO materiaDao;
	
	public void setMateriaDao(MateriaDAO materiaDao) {
		this.materiaDao = materiaDao;
	}
	
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
		List<Materia> listamaterie = materiaDao.getAll();
		return new ModelAndView( "materie/listaMaterie", "listamaterie", listamaterie );
	}

	
}
